package cn.hr.entity;


import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;


/**
 * 学院实体类
 */
@Entity
@Table(name="tb_college"
    ,catalog="hrm"
)

public class College  implements java.io.Serializable {


    // Fields    

     /**
	 * 
	 */
	private static final long serialVersionUID = -6518995039510018351L;
	private Integer id;
     private String collegeName;
     private Set<Specialty> specialties = new HashSet<Specialty>(0);
     private Set<Company> companies = new HashSet<Company>(0);


    // Constructors

    /** default constructor */
    public College() {
    }

	/** minimal constructor */
    public College(String collegeName) {
        this.collegeName = collegeName;
    }
    
    /** full constructor */
    public College(String collegeName, Set<Specialty> specialties, Set<Company> companies) {
        this.collegeName = collegeName;
        this.specialties = specialties;
        this.companies = companies;
    }

   
    // Property accessors
    @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="id", unique=true, nullable=false)

    public Integer getId() {
        return this.id;
    }
    
    public void setId(Integer id) {
        this.id = id;
    }
    
    @Column(name="collegeName", nullable=false, length=32)

    public String getCollegeName() {
        return this.collegeName;
    }
    
    public void setCollegeName(String collegeName) {
        this.collegeName = collegeName;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="college")

    public Set<Specialty> getSpecialties() {
        return this.specialties;
    }
    
    public void setSpecialties(Set<Specialty> specialties) {
        this.specialties = specialties;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="college")

    public Set<Company> getCompanies() {
        return this.companies;
    }
    
    public void setCompanies(Set<Company> companies) {
        this.companies = companies;
    }
   








}